<?php

namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;

use Illuminate\Notifications\Notifiable;
use Zizaco\Entrust\Traits\EntrustUserTrait;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Spatie\Permission\Traits\HasRoles;

class WorkerMerchant extends Authenticatable implements JWTSubject
{

    public $user_id;
    public $worker_phone;
    public $phone;
    public $store_id;
    public $wid;


    /**
     * Get the identifier that will be stored in the subject claim of the JWT
     *
     * @return mixed
     */
    public function getJWTIdentifier()
    {
        return $this->getUserId();
    }

    /**
     * Return a key value array, containing any custom claims to be added to the JWT
     *
     * @return array
     */
    public function getJWTCustomClaims()
    {
        return [];
    }

    public function getUserId()
    {

        return [
            'type' => 'worker_merchant',
            'user_id' => $this->user_id,
            'worker_phone' => $this->worker_phone,
            'phone' => $this->phone,
            'store_id' => $this->store_id,
            'wid' => $this->wid,
        ];//返回用户id
    }

}
